{php include wl_template('common/header');}
<ul class="nav nav-tabs" style="margin-bottom: 0px;">
    <li class="active"><a href="javascript:;">评价参数 </a></li>
</ul>

    <div class="tab-pane" id="tab_param">
    <div class="panel panel-default">
        <div class="panel-heading">评价参数设置 <b style="color: red">(项目运行后请勿随意修改设置，以免导致数据紊乱！)</b></div>
        <div class="panel-body">
            <div class="panel-body">
                <form action="" method="post" class="form-horizontal form" id="form">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">服务时间</label>
                    <div class="col-md-9">
                        <table class="table table-hover">
                            <thead>
                            <tr>
                                <th style='width:50px;'></th>
                                <th>评价名称</th>
                                <th>权重(权重总和必须等于1)</th>
                            </tr>
                            </thead>
                            <tbody id="param-items">
                            {loop $list $p}
                            <tr>
                                <td>
                                    <a href="javascript:;" class="fa fa-move" title="拖动调整此显示顺序"><i class="fa fa-arrows"></i></a>&nbsp;
                                    <a href="javascript:;" onclick="deleteParam(this)" style="margin-top:10px;" title="删除"><i class='fa fa-remove'></i></a>
                                </td>
                                <td>
                                    <input name="param_title[]" type="text" class="form-control param_title" value="{$p['name']}"/>
                                    <input name="param_id[]" type="hidden" class="form-control" value="{$p['id']}"/>
                                </td>
                                <td><input name="param_value[]" type="text" class="form-control param_value" value="{$p['weight']}"/></td>
                            </tr>
                            {/loop}
                            </tbody>
                            <tbody>
                            <tr>
                                <td colspan="3">
                                    <a href="javascript:;" id='add-param' onclick="addParam()" style="margin-top:10px;"  title="添加属性">添加属性 <i class='fa fa-plus'></i></a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                    <div class="form-group col-sm-12">
                        <input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
                        <input type="hidden" name="token" value="{$_W['token']}" />
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script language="javascript">
    $(function(){
        $("#chkoption").click(function(){
            var obj =$(this);
            if(obj.get(0).checked){
                $("#tboption").show();
                $(".trp").hide();
            }
            else{
                $("#tboption").hide();
                $(".trp").show();
            }
        });
    });
    function addParam() {
        var url = "{php echo web_url('goods/param')}";
        $.ajax({
            "url": url ,
            success:function(data){
                $('#param-items').append(data);
            }
        });
        return;
    }
    function deleteParam(o) {
        $(o).parent().parent().remove();
    }
</script>
{php include wl_template('common/footer');}